package 统计算法.可被5整除的二进制前缀;

import java.util.ArrayList;
import java.util.List;

public class kbwzcdejzqz {

    public static void main(String[] args) {
//        int[] arr = {0,1,1};
        int[] arr = {0,1,1,1,1,1};
//        int[] arr = {1,0,0,1,0,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,0,0,0,0,1,1,0,1,0,0,0,1};
        System.out.println(prefixesDivBy5(arr));
    }
    static int mod = (int) 1e9 + 7;

    public static List<Boolean> prefixesDivBy5(int[] nums) {
        List result = new ArrayList();
        int index = 0;
        for (int i = 0; i < nums.length; i++) {
            //取个位数重点
             index = (index*2+nums[i]) % 10 ;;
            System.out.println("个位数"+index);
            result.add((index) == 0 || (index) == 5);
        }
        return result;
    }
}
